package com.my.study.designPatterns.proxyPattern;

import javax.swing.*;
import java.awt.*;
import java.net.URL;

public class ImageProxyTestDriver {

    JFrame jFramel;
    ImageComponent imageComponent;

    public static void main(String[] args) throws Exception{



        ImageProxyTestDriver imageProxyTestDriver = new ImageProxyTestDriver();


    }

    public ImageProxyTestDriver() throws Exception{


        URL initialURL = new URL("http://image.baidu.com/search/detail?ct=503316480&z=0&ipn=false&word=%E5%A3%81%E7%BA%B8&step_word=&hs=0&pn=12&spn=0&di=124410&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=2&ie=utf-8&oe=utf-8&in=&cl=2&lm=-1&st=-1&cs=2866289165%2C1648338696&os=3512203934%2C1960765337&simid=3422763348%2C301041969&adpicid=0&lpn=0&ln=3590&fr=&fmq=1567133149621_R&fm=&ic=0&s=undefined&hd=0&latest=0&copyright=0&se=&sme=&tab=0&width=&height=&face=undefined&ist=&jit=&cg=wallpaper&bdtype=0&oriquery=&objurl=http%3A%2F%2Fimg5.xiazaizhijia.com%2Fwalls%2F20161229%2F1440x900_7a9a19f7e5a986f.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3Bxtwzwtzit3tw_z%26e3Bv54AzdH3FktzitAzdH3Fbnd0l_z%26e3Bip4s&gsm=&rpstart=0&rpnum=0&islist=&querylist=&force=undefined");
        Icon icon = new ImageProxy(initialURL);
        imageComponent = new ImageComponent(icon);
        jFramel = new JFrame();
        jFramel.setName("LLLLLLL");
        jFramel.setVisible(true);
        jFramel.setTitle("Hahahah-----");


        JLabel label = new JLabel();
        label.setIcon(icon);
        jFramel.getContentPane().add(label);

        jFramel.setBounds(0,0, 1000,1000);
    }
}
